package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.InterTillMapper;
import com.youlai.boot.system.mapper.WinteringMapper;
import com.youlai.boot.system.model.QB.Wintering;
import com.youlai.boot.system.service.WinteringService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class WinteringServiceImpl extends ServiceImpl<WinteringMapper, Wintering> implements WinteringService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private WinteringMapper winteringMapper;
    @Override
    public boolean saveWintering(Wintering wintering) {

        wintering.setAddtime(LocalDateTime.now());
        return save(wintering);
    }

    @Override
    public List<Wintering> getAllWintering() {
        return winteringMapper.selectList(null);
    }

    @Override
    public boolean deleteWinteringById(Integer id) {
        return winteringMapper.deleteById(id) > 0;
    }
}
